<?php

/**
 * SfOwned form.
 *
 * @package    ##PROJECT_NAME##
 * @subpackage form
 * @author     ##AUTHOR_NAME##
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class SfOwnedForm extends BaseSfOwnedForm
{
    public function configure()
    {
        $this->setWidgets(array(
          'peer_name' => new sfWidgetFormInputHidden(),
          'owned_id'  => new sfWidgetFormInputHidden(),
          'owner_id'  => new sfWidgetFormPropelChoiceMany(array('model' => 'sfGuardUser')),
          'id'        => new sfWidgetFormInputHidden(),
        ));

        $this->setValidators(array(
          'peer_name' => new sfValidatorString(array('max_length' => 255, 'required' => true)),
          'owned_id'  => new sfValidatorInteger(array('required' => true)),
          'owner_id'  => new sfValidatorPropelChoiceMany(array('model' => 'SfGuardUser', 'column' => 'id', 'required' => true)),
          'id'        => new sfValidatorPropelChoice(array('model' => 'SfOwned', 'column' => 'id', 'required' => false)),
        ));

        $this->widgetSchema->setNameFormat('sf_owned[%s]');
    }
}
